﻿@{
    ViewBag.Title = "IndentList";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<script>
    $(function () {
        gridList();
    })
    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            url: "/BusinessManage/D_Indent/GeMemtGridJson",
            datatype: "json",
            height: $(window).height() - 128,
            colModel: [
                { label: '主键', name: 'F_Id', hidden: true },
                { label: '下单人姓名', name: 'F_MemName', width: 80, align: 'left' },
                { label: '下单人账号', name: 'F_MemAccount', width: 80, align: 'left' },
                { label: '联系电话', name: 'F_MemTel', width: 80, align: 'left' },
                { label: '商品名称', name: 'F_Name', width: 80, align: 'left' },
                { label: '商品规格', name: 'F_Spec', width: 80, align: 'left' },
                { label: '商品价格', name: 'F_Price', width: 80, align: 'left' },
                { label: '商品描述', name: 'F_Summary', width: 80, align: 'left' },
                {
                    label: '订单状态', name: 'F_EnabledMark', width: 80, align: 'left',
                    formatter: function (cellvalue, options, rowObject) {
                        if (cellvalue == 1) {
                            return '<span class=\"label label-success\">已发货</span>';
                        } else if (cellvalue == 0) {
                            return '<span class=\"label label-default\">未发货</span>';
                        }
                    }
                },
                {
                    label: '创建时间', name: 'F_CreatorTime', width: 130, align: 'left',
                    formatter: "date", formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s' }
                },
                { label: '备注', name: 'F_Description', width: 180, align: 'left' },
                { label: '收货地址', name: 'F_OrderAddress', width: 80, align: 'left' }
            ],
            pager: "#gridPager",
            sortname: 'F_CreatorTime desc',
            viewrecords: true
        });
        $("#btn_search").click(function () {
            $gridList.jqGrid('setGridParam', {
                postData: {pData: JSON.stringify({ F_Name: $("#txt_F_Name").val(),F_MemAccount:$("#txt_F_MemAccount").val(),F_MemName:$("#txt_F_MemName").val(),F_EnabledMark:$("#txt_F_EnabledMark").val() })},
            }).trigger('reloadGrid');
        });
    }
    function btn_details() {
        var keyValue = $("#gridList").jqGridRowValue().F_Id;
        $.modalOpen({
            id: "Details",
            title: "确认发货",
            url: "/BusinessManage/D_Indent/Form?keyValue=" + keyValue,
            width: "700px",
            height: "750px",
            callBack: function (iframeId) {
                top.frames[iframeId].submitForm();
            }
        });
    }
</script>

<div class="topPanel">
    <div class="toolbar">
        @*<div class="btn-group">
            <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
        </div>*@
        <div class="btn-group">
            <a id="NF-add" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>新建用户</a>
        </div>
        <div class="operate">
            <ul class="nav nav-pills">
                <li class="first">已选中<span>1</span>项</li>
                <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改用户</a></li>
                <li><a id="NF-delete" authorize="yes" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除用户</a></li>
                <li><a id="NF-Details" authorize="yes" onclick="btn_details()"><i class="fa fa-search-plus"></i>确认发货</a></li>
                <li class="split"></li>
                <li><a id="NF-revisepassword" authorize="yes" onclick="btn_revisepassword()"><i class="fa fa-key"></i>密码重置</a></li>
                <li class="split"></li>
                <li><a id="NF-disabled" authorize="yes" onclick="btn_disabled()"><i class="fa fa-stop-circle"></i>禁用</a></li>
                <li><a id="NF-enabled" authorize="yes" onclick="btn_enabled()"><i class="fa fa-play-circle"></i>启用</a></li>
            </ul>
            <a href="javascript:;" class="close"></a>
        </div>
        <script>$('.toolbar').authorizeButton()</script>
    </div>
    <div class="search">
        <table>
            <tr>
                <td>
                    <div class="input-group">
                        <input id="txt_F_MemName" type="text" class="form-control" placeholder="下单人姓名" style="width: 100px;">
                        <input id="txt_F_MemAccount" type="text" class="form-control" placeholder="下单人账号" style="width: 100px;">
                        <input id="txt_F_Name" type="text" class="form-control" placeholder="商品名称" style="width: 100px;">
                        <select id="txt_F_EnabledMark" class="form-control" style="width: 100px;">
                            <option value="false" selected>未发货</option>
                            <option value="true">已发货</option>
                        </select>
                        <span class="input-group-btn">
                            <button id="btn_search" type="button" class="btn  btn-primary"><i class="fa fa-search"></i></button>
                        </span>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</div>
<div class="gridPanel">
    <table id="gridList"></table>
    <div id="gridPager"></div>
</div>

